package com.pucheng.bracelet.app.database.repository

import androidx.annotation.WorkerThread
import com.pucheng.bracelet.app.database.dao.StepDao
import com.pucheng.bracelet.data.bean.StepsBean
import kotlinx.coroutines.flow.Flow

class StepsRepository(private val stepsDao: StepDao) {

    //查询所有数据
    val to7DayData: Flow<List<StepsBean>> = stepsDao.get7Days()

    //查询所有数据
    val allData: Flow<List<StepsBean>> = stepsDao.getAll()

    // 插入数据
    @Suppress("RedundantSuspendModifier")
    @WorkerThread
    suspend fun insert(stepsBean: StepsBean) {
        stepsDao.insert(stepsBean)
    }


}